<template>
  <div>
    <van-address-edit
      :area-list="areaList"
      show-delete
      show-set-default
      :area-columns-placeholder="['请选择', '请选择', '请选择']"
      :address-info="useraddr"
      :area-placeholder="currarea"
      @save="onSave"
      @delete="onDelete"
    />
  </div>
</template>

<script>
import { areaList } from "@vant/area-data";
export default {
  data() {
    return {
      useraddr: {},
      areaList,
    };
  },
  mounted() {
    let res = JSON.parse(localStorage.getItem("useraddr"));
    this.useraddr = res;
  },
  methods: {
    onSave() {
      console.log("save");
    },
    onDelete() {
      console.log("delete");
    },
  },
  computed: {
    currarea() {
      let res = "";
      let list = this.useraddr;
      res += list.province + " " + list.city + " " + list.county;
      return res;
    },
  },
};
</script>

<style>
</style>